using System;

namespace Beauty.Net.Middleware
{
    public class LoggingOptions
    {
        public LogStorageType StorageType { get; set; } = LogStorageType.Console; // 默认使用控制台输出
        
        // MySQL配置
        public string MySqlConnectionString { get; set; }
        public string MySqlTableName { get; set; } = "ApiLogs";
        
        // Elasticsearch配置
        public string ElasticsearchUri { get; set; }
        public string ElasticsearchIndex { get; set; } = "api-logs";
        
        // MongoDB配置
        public string MongoDbConnectionString { get; set; }
        public string MongoDbDatabaseName { get; set; } = "ApiLogs";
        public string MongoDbCollectionName { get; set; } = "logs";
        
        // 是否记录请求体
        public bool LogRequestContent { get; set; } = true;
        
        // 是否记录响应体
        public bool LogResponseContent { get; set; } = true;
        
        // 排除的路径，不记录日志
        public string[] ExcludePaths { get; set; } = Array.Empty<string>();
        
        // 最大日志大小（字节）
        public int MaxLogSize { get; set; } = 1024 * 1024; // 1MB
    }
    
    public enum LogStorageType
    {
        Console,
        MySql,
        Elasticsearch,
        MongoDB
    }
}